package map.android.baidu.carpool.utils;

import android.content.Context;
import android.widget.Toast;
import com.baidu.components.api.extra.APIProxy;
import com.baidu.lbs.net.http.response.ComNetResponse;

public class ToastForCarpool {

	public static void showResponseErrorMsg(Context context, ComNetResponse response) {
	}

	public static void showLong(Context context, String text) {
		show(context, text, Toast.LENGTH_LONG);
	}

	public static void showLong(Context context, int strId) {
		String text = APIProxy.res().getString(strId);
		showLong(context, text);
	}

	public static void show(Context context, int resId) {
		String text = APIProxy.res().getString(resId);
		show(context, text, Toast.LENGTH_LONG);
	}

	public static void show(Context context, String text) {
		show(context, text, Toast.LENGTH_LONG);
	}

	public static void show(Context context, String text, int duration) {
		if (context == null) {
			return;
		}
		try {
//			LayoutInflater inflater = APIProxy.res().getInflater();
//			View rootView = inflater.inflate(R.layout.car_toast, null);
//			TextView infoTextView = (TextView) rootView.findViewById(R.id.car_toast_info_textview);
//			infoTextView.setText(text);
//
//			Toast toast = new Toast(context);
//			toast.setDuration(duration);
//			toast.setGravity(Gravity.CENTER, 0, 0);
//			toast.setView(rootView);
//			toast.show();
            
            Toast.makeText(context, text, duration).show();

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
